package com.mybatisflex.demo.entity;

import com.mybatisflex.annotation.*;
import com.mybatisflex.core.handler.Fastjson2TypeHandler;
import com.mybatisflex.core.mask.Masks;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author 王帅
 * @since 2023-07-18
 */
@Data
@Table(
        value = "tb_card",
        camelToUnderline = false
//        onInsert = {CardInsertListener.class},
//        onUpdate = {CardUpdateListener.class}
)
@SuppressWarnings("all")
public class Card {

    @Id(keyType = KeyType.Auto)
    private Long id;
    @ColumnMask("idNumber")
    private String idNumber;
    private String location;
    @Column(onInsertValue = "NOW()")
    private LocalDateTime createTime;
    @Column(onUpdateValue = "NOW()")
    private LocalDateTime updateTime;
    @Column(isLogicDelete = true)
    private Integer delFlag;
    @Column(version = true)
    private Integer version;
    @Column(tenantId = true)
    private Integer tenantId;
    @Column(typeHandler = Fastjson2TypeHandler.class)
    private Map<String, Object> options;
    @ColumnMask(Masks.EMAIL)
    private String email;
    private TypeEnum type;

}